package com.example.AIstudy.controller;

import com.example.AIstudy.domain.FalseReason;
import com.example.AIstudy.service.FalseReasonService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/falseReason")
@Api(tags = "错误原因信息管理API")
public class FalseReasonController {
    @Autowired
    FalseReasonService falseReasonService;

    @ApiOperation("根据用户ID查询错误原因")
    @GetMapping("/userID")
    List<FalseReason> findReasonByUserID(@ApiParam("用户ID")@RequestParam(value = "userID")Integer userID){
            return falseReasonService.findReasonByUserID(userID);
    }
}
